
#pragma once

#include "Core/Definitions.h"
#include <vector>

using namespace System;
using namespace NUnit::Framework;

namespace ttgLibTests
{
	[TestFixture]
	public ref class Definitions
	{
		public:
			[Test]
			void SAFE_DELETE()
			{
				int *pInt = new int();
				ttgLib::SAFE_DELETE(pInt);
				Assert::AreEqual((int)pInt, NULL, "Wasn't nulled");
			}

			[Test]
			void SAFE_DELETE_ARRAY()
			{
				int *pInt = new int[42];
				ttgLib::SAFE_DELETE_ARRAY(pInt);
				Assert::AreEqual((int)pInt, NULL, "Wasn't nulled");
			}

			[Test]
			void SAFE_DELETE_CONTENT()
			{
				std::vector<char *> strings(3);
				strings[0] = new char[128];
				strings[1] = new char[256];
				strings[2] = new char[512];
				ttgLib::SAFE_DELETE_CONTENT(&strings);
				Assert::AreEqual((int)strings.size(), 0, "Wasn't cleared");
			}

			[Test]
			void Version()
			{
				std::string ver = ttgLib::Version::ToString();
				ver = ttgLib::Version::ToString();
				Assert::AreNotEqual((int)ver.size(), 0, "Wasn't setted");
			}
	};
}